function RenderableObjectManager PathFile Cores InstBycore Instances=
(
	-- TODO path con data/level/etc?
	FileName = Pathfile + "\\Renderable_Objects.xml"
	local file = createfile fileName
	format "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" to:file
	format "<renderable_objects>" to:file
	
	for i=1 to Instances.count do
	(
		try
		(
			if (getUserProp Instances[i] "Export") then
			(
				format "\t<mesh_instance  Layer=\"%\"  Name=\"%\"  Core=\"%\"  Pos=\"% % %\"  Yaw=\"%\"  Pitch=\"%\"  Roll=\"%\" Scale= \"%\">\n" (getUserProp Instances[i] "Layer") Instances[i].name InstByCore[i].name Instances[i].position.x Instances[i].position.y Instances[i].position.z (GetYaw Instances[i].transform) (GetPitch Instances[i].transform) (GetRoll Instances[i].transform) (RHTranslationToLH Instances[i].transform.scale) to:file
			)
			
		)
		catch
		(
			messagebox ("el objeto "+($[i].name as string )+" no tiene export property")
		)
		
		
	)--fin for

	format "<renderable_objects>" to:file
	fflush file
	close file
)
